				Nice 2.01
				=========


Nice is a small utility that provides a very simple priority system on
Wimp tasks, a bit like under Unix. I wrote it because the RC5DES client
was slowing down my machine, and Nice solves this problem quite well.


NOTE: the module should be RMRun'ed (use Filer_Run from a TaskWindow);
RMLoad'ing it isn't sufficient (except outside the desktop), since it
needs to be run as a Wimp task to receive the TaskInitialise messages.
If it is loaded only, it won't detect starting applications.


The module provides 3 commands: nice, nice+ and nicestat.
Use *nice <time> <task> to nice an existing task, e.g.
  *nice 25 "RC5DES client"
If the time is 0, the task will no longer be niced. The nice+ command is
similar to nice and has the same syntax, but is permanent; the task does
not need to exist yet: each time it is run, it will automatically be niced.
This is particularly useful for the RC5DES client, which is often quit and
restarted. The nicestat command displays the status of Nice and statistics
about the niced tasks.

To give a task a low priority, use nice or nice+ on it and choose the
time in such a way that when the machine is idle, the task takes most
of the CPU time, and when another task is running and needs CPU time,
the niced task takes no CPU time (or very little). This time depends
on your configuration; you can use the utilities by David J. Ruck (see
<ftp://ftp.armclub.org.uk/pub/pd/druck/>) to find the best value.

Note: you can nice several tasks, but this may not work very well; in
fact, I haven't tested this to see whether this is efficient or not.

Some technical information... A Wimp filter on null events is installed
for the niced tasks. If the time of the last 2 null-reason Wimp_Polls is
greater or equal to the specified time, the event won't be passed to the
task. The nicestat command displays, for each niced task: the specified
time and the number of filtered null-reason Wimp_Polls among the last
64 null-reason Wimp_Polls. This second value should be small when your
machine is idle, and it should be 64 (or near 64) when a more important
task is running; but even if it is quite large when the machine is idle,
the task may take most of the CPU time (this is because when the null
event is not passed to the task, the next null event will occur very
quickly).


Here are some results, with the 3 conditions: RC5 client stopped, RC5
client running and niced, RC5 client running and not niced. I opened
a very large web page with !Browse, did a CRC calculation, and did an
"unzip -t".

               Opening a web page
                 fetch  process     CRC    unzip
RC5 stopped       42s     40s       16s     11s
nice 25 RC5       43s     61s       16s     11s
RC5 unniced       44s     88s       25s     16s

When the machine is idle (*), here are the kkeys/s values given by the
speed benchmark function of the RC5DES GUI, on my machine:

           RC5   DES
unniced    201   471
nice 25    198   465

(*) well, not really, because the benchmark GUI takes CPU time.


Nice is freeware. Use it at your own risk. You may freely distribute it
under the condition that the files are not modified or removed and that
you do not make any profit. The assembly source is supplied so that you
can modify it for yourself if you want to. If you wish to distribute a
modified version, please contact me before doing so. Send any suggestions
or bug reports to <nice@vinc17.org>.


Vincent Lefvre <vincent@vinc17.org>

WWW (home page): http://www.vinc17.org/
WWW (Risc PC page): http://www.vinc17.org/acorn/

$Id: !ReadMe 1.7 2003/05/25 10:09:17 vlefevre Exp $
